﻿using UnityEngine;

namespace Mars.Pathfinding
{
    public static class GizmoUtils
    {
        public static void DrawArrow(Vector3 start, Vector3 end, Color color, float arrowSize)
        {
            Gizmos.color = color;
            Gizmos.DrawLine(start, end);
        
            Vector3 direction = (end - start).normalized;
            Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + 25, 0) * Vector3.forward;
            Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 - 25, 0) * Vector3.forward;
        
            Gizmos.DrawLine(end, end + right * arrowSize);
            Gizmos.DrawLine(end, end + left * arrowSize);
        }
    }
}